<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

<h:head>
	<title>Pacchetti In GiftList</title>
</h:head>

<h:body>
<div id="spaziatura">
<full_page id="main">
	<!-- 		HEADER -->
			<div>
						<img src="../resources/Images/Banner.png" id="bannerTop"></img>
			</div>
			<!-- 		HEADER -->
			<div>
						<img src="../resources/Images/Banner_piccolo.png" id="bannerBottom_sx"></img>
			</div>

			<div>
						<img src="../resources/Images/Logo_td_big.png" id="logoTD"></img>
			</div>

			<div>
						<img src="../resources/Images/Banner_piccolo_dx.png" id="bannerBottom_dx"></img>
			</div>
			
			<div>
						<img src="../resources/Images/Bg.png" id="background"></img>
			</div>
			
			<div>
						<img src="../resources/Images/giftsil.png" id="bottomlogo_gift"></img>
			</div>
			
		<!--TITOLO E SOTTOTITOLO-->
		<title_box>
		<title_TD>TravelDream</title_TD>
		</title_box>
		<!--FINE TITOLO E SOTTOTITOLO-->

		    <box_login>
				<yellow_text id="topRightReg">User Section</yellow_text>
      		</box_login>
      		

      	<full_page id="menuTop_con_banner">
      	<!-- 	MENUBAR -->

	<p:menubar autoDisplay="false">
			<p:menuitem value="Compra Pacchetto Predefinito" url="SelPacchettoPred.xhtml"/>
		<p:submenu label="Crea Pacchetto Personalizzato">
			<p:menuitem value="Parti da un pacchetto predefinito" url="PPers.xhtml"/>
			<p:menuitem value="Parti da zero" url="creaPPers.xhtml"/>
		</p:submenu>
			<p:menuitem value="Pacchetti Acquistati" url="ViewPacComprato.xhtml"/>
			<p:menuitem value="Gift List" url="ViewPacGL.xhtml"/>
			<p:menuitem value="Fai Un Regalo!" url="regalaGL.xhtml"/>
			<p:menuitem value="Home" url="index.xhtml"/>
	</p:menubar>
	
<!-- 	MENUBAR -->
<yellow_text id="sceglipacchetto">La tua Gift List  #{userBean.name}!</yellow_text>

</full_page>

</full_page>

</div>


<div id="spaziatura">
	<h:form id="selP" onsubmit="#{RetrievePacchetto.selectThisGL(userBean.email)}">


			<p:dataTable id="viaggi" var="v" value="#{RetrievePacchetto.PPL}"
			rowKey="#{v.numRiga}" paginator="true" rows="10" widgetVar="ViaggiT"
			filteredValue="#{RetrievePacchetto.filteredPP}"
			selectionMode="single" selection="#{CreaPP.current}">

			<p:ajax event="rowSelect" update=":selP:display"
				oncomplete="PF('infoDialog').show()" listener="#{RetrievePacchetto.findEsc(CreaPP.current)}"/>
			<p:ajax event="rowUnselect" update=":selP:"/>


			<f:facet name="header">  
				<p:panelGrid>
					<p:row>
<!-- 						<p:column width="35%"> -->
<!-- 							<p:outputLabel> -->
<!-- 								<h:outputText value="Selezionato da:" /> -->
<!-- 								<p:selectOneMenu value="#{CreaPP.appMail}" id="email" -->
<!-- 									panelStyle="width:150px" style="width:200px"> -->
<!-- 									<f:selectItem itemLabel="#{userBean.email}" -->
<!-- 										itemValue="#{userBean.email}" /> -->
<!-- 								</p:selectOneMenu> -->
<!-- 							</p:outputLabel> -->
<!-- 						</p:column> -->

<!-- 						<p:column width="35%"> -->
<!-- 							<p:outputLabel> -->
<!-- 								<h:outputText value="Numero di Persone:" /> -->
<!-- 								<p:selectOneMenu id="np" value="#{CreaPP.nPersone}"> -->
<!-- 									<f:selectItems value="#{RetrievePacchetto.totP}" var="numeroP" -->
<!-- 										itemLabel="#{numeroP}" itemValue="#{numeroP}" /> -->
<!-- 								</p:selectOneMenu> -->
<!-- 							</p:outputLabel> -->
<!-- 						</p:column> -->

                       <p:column style="width:50%">Seleziona il tuo viaggio!</p:column>
						<p:column>
							<p:outputPanel>
								<h:outputText value="Cerca parola chiave:" />
								<p:inputText id="globalFilter" onkeyup="ViaggiT.filter()"
									style="width:150px" />
							</p:outputPanel>
						</p:column>
					</p:row>


				</p:panelGrid>
			</f:facet>
			<!-- 			<p:column selectionMode="single" style="width:2%" /> -->

			<p:column id="numR" headerText="Codice Gift List" filterBy="numRiga" filterMatchMode="contains" style="width:1%">
				#{v.numRiga}
			</p:column>

<!-- 			<p:column id="nomeColumn" headerText="ID Pacchetto" filterBy="id" filterMatchMode="contains" style="width:3%"> -->
<!-- 				#{v.id} -->
<!-- 			</p:column> -->


			<!--         <p:column headerText="ID" style="width:8%">   -->
			<!--             #{v.id}   -->
			<!--         </p:column>   -->

			<!--           <p:column headerText="Nome Pacchetto" style="width:20%">   -->
			<!--             #{v.nome}   -->
			<!--         </p:column>   -->

			<p:column id="nomeP" filterBy="nome" headerText="Nome Pacchetto"
				filterMatchMode="contains">
				#{v.nome}
			</p:column>

			<p:column id="cittaColumn" filterBy="citta" headerText="Città"
				filterMatchMode="contains">
				#{v.citta}
			</p:column>

			<!--         <p:column headerText="Data Partenza" style="width:35%">   -->
			<!--             #{v.data_Partenza}   -->
			<!--         </p:column>   -->
<!-- 			<p:column id="dataP" filterBy="data_Partenza" -->
<!-- 				headerText="Data Partenza" filterMatchMode="contains" -->
<!-- 				style="width:28%"> -->
<!-- 				<p:cellEditor> -->
<!-- 					<f:facet name="output"> -->
<!-- 						<h:outputText value="#{v.data_Partenza}" /> -->
<!-- 					</f:facet> -->
<!-- 					<f:facet name="input"> -->
<!-- 						<p:inputText value="#{v.data_Partenza}" /> -->
<!-- 					</f:facet> -->
<!-- 				</p:cellEditor> -->
<!-- 			</p:column> -->


			<!--         <p:column headerText="Data Ritorno" style="width:35%">   -->
			<!--             #{v.data_Ritorno}   -->
			<!--         </p:column>   -->
<!-- 			<p:column id="dataR" filterBy="data_Ritorno" -->
<!-- 				headerText="Data Ritorno" filterMatchMode="contains" -->
<!-- 				style="width:28%"> -->
<!-- 				<p:cellEditor> -->
<!-- 					<f:facet name="output"> -->
<!-- 						<h:outputText value="#{v.data_Ritorno}" /> -->
<!-- 					</f:facet> -->
<!-- 					<f:facet name="input"> -->
<!-- 						<p:inputText value="#{v.data_Ritorno}" /> -->
<!-- 					</f:facet> -->
<!-- 				</p:cellEditor> -->
<!-- 			</p:column> -->
			<!--         <p:column headerText="Prezzo Finale" style="width:20%">   -->
			<!--             #{v.prezzo}   -->
			<!--         </p:column>  -->


			<p:column id="PrezzoP" filterBy="prezzo"
				headerText="Prezzo Totale" filterMatchMode="contains">
				#{v.prezzo}
			</p:column>

			<!-- 			<p:column id="buttun" headerText="Dettagli" style="width:4%">   -->
			<!-- 			<p:cellEditor> -->
			<!-- 			<f:facet name="output"> -->
			<!--                 <p:commandButton id="infoButton" update=":selP:display" oncomplete="PF('infoDialog').show()" icon="ui-icon-search" title="View">   -->
			<!--                <f:setPropertyActionListener value="#{v}" target="#{CreaPP.current}" />    -->
			<!--             </p:commandButton>   -->
			<!--             </f:facet> -->
			<!--             <f:facet name="input"> <p:commandButton id="infoButton2" update=":selP:display" oncomplete="PF('infoDialog').show()" icon="ui-icon-search" title="View">   -->
			<!--                <f:setPropertyActionListener value="#{v}" target="#{CreaPP.current}" />    -->
			<!--             </p:commandButton> </f:facet> -->
			<!--             </p:cellEditor> -->
			<!--         </p:column>   -->
			<!-- 			<f:facet name="footer"> -->
			<!--                 <p:growl id="growl" showDetail="true" sticky="true" /> -->
			<!-- 				<p:commandButton id="compra" value="Compra!" icon="ui-icon-cart" -->
			<!-- 					update="growl" action="#{CreaPP.createUtente()}" /> -->
			<!-- 				<p:commandButton id="GL" value="Metti in GiftList!" -->
			<!-- 					icon="ui-icon-document" update="growl" -->
			<!-- 					action="#{CreaPP.giftListUtente()}" /> -->
			<!-- 			</f:facet> -->
		</p:dataTable>






		<p:dialog header="Dettagli Viaggio" widgetVar="infoDialog" resizable="true"
			id="infoDlg" showEffect="fade" hideEffect="explode" modal="true" width="90%" height="450px">
			<h:panelGrid id="display" columns="2" cellpadding="4"
				style="margin:0 auto;">
				<h:outputText value="Nome Pacchetto:" />
				<h:outputText value="#{CreaPP.current.nome}"
					style="font-weight:bold" />

				<h:outputText value="Città:" />
				<h:outputText value="#{CreaPP.current.citta}"
					style="font-weight:bold" />

				<h:outputText value="Data Partenza:" />
				<h:outputText value="#{CreaPP.current.data_Partenza}"
					style="font-weight:bold" />

				<h:outputText value="Data Ritorno:" />
				<h:outputText value="#{CreaPP.current.data_Ritorno}"
					style="font-weight:bold" />
					
				<h:outputText value="Andata:" />
				<h:outputText value="#{RetrievePacchetto.mezzoAndata.tipo} #{RetrievePacchetto.mezzoAndata.luogoPartenza}-#{RetrievePacchetto.mezzoAndata.luogoArrivo} delle #{RetrievePacchetto.mezzoAndata.oraPartenza}"
					style="font-weight:bold" />
                
                <h:outputText value="Ritorno:" />
				<h:outputText value="#{RetrievePacchetto.mezzoRitorno.tipo} #{RetrievePacchetto.mezzoRitorno.luogoPartenza}-#{RetrievePacchetto.mezzoRitorno.luogoArrivo} delle #{RetrievePacchetto.mezzoRitorno.oraPartenza}"
					style="font-weight:bold" />
					
				<h:outputText value="Hotel:" />
				<h:outputText value="#{RetrievePacchetto.hotelPacchetto.nomeHotel} sito in: #{RetrievePacchetto.hotelPacchetto.indirizzo} Stelle: #{RetrievePacchetto.hotelPacchetto.stelle}"
					style="font-weight:bold" />

				<h:outputText value="Prezzo:" />
				<h:outputText value="#{CreaPP.current.prezzo}"
					style="font-weight:bold" />
					
				<h:outputText value="Escursione:" />
				<p:dataList value="#{RetrievePacchetto.EList}" var="esc" itemType="circle">  
                 <b>Nome:</b> #{esc.nomeEscursione}; <b>Partenza:</b> #{esc.cittaP}; <b>Luogo:</b> #{esc.cittaE}; <b>Mezzo:</b> #{esc.mezzo}
                </p:dataList> 
					
			    <p:outputLabel> 
				<h:outputText value="Numero di persone:" /></p:outputLabel>
				<h:outputText value="#{CreaPP.current.numPren}"
					style="font-weight:bold" />            
			

				<h:outputText value="A nome di:" />
				<p:selectOneMenu value="#{CreaPP.current.email}" id="email"
					panelStyle="width:150px" style="width:200px">
					<f:selectItem itemLabel="#{userBean.email}"
						itemValue="#{userBean.email}" />
				</p:selectOneMenu>
				
				<h:outputText value="Paga intero viaggio, Euro: #{RetrievePacchetto.PDTOCurrent.prezzo}:" />
				   <p:selectBooleanButton value="#{CreaPP.current.pagatoPacchetto}" offLabel="Paga!" onLabel="Pagato" offIcon="ui-icon-check" 
				   onIcon="ui-icon-close"  disabled="#{RetrievePacchetto.pagato.pagatoPacchetto}"/>  
           
				   
				<h:outputText value="Paga Hotel, Euro: #{RetrievePacchetto.PDTOCurrent.prezzoHotel}:" />
				   <p:selectBooleanButton value="#{CreaPP.current.pagatoHotel}" offLabel="Paga!" onLabel="Pagato" offIcon="ui-icon-check" 
				   onIcon="ui-icon-close"  disabled="#{RetrievePacchetto.pagato.pagatoHotel}"/> 
           
				
				<h:outputText value="Paga Mezzi di trasporto, Euro: #{RetrievePacchetto.PDTOCurrent.prezzoMezzo}:" />
				  <p:selectBooleanButton value="#{CreaPP.current.pagatoMezzo}" offLabel="Paga!" onLabel="Pagato" offIcon="ui-icon-check" 
				   onIcon="ui-icon-close"  disabled="#{RetrievePacchetto.pagato.pagatoMezzo}"/>  
           
				
				<h:outputText value="Paga le escursioni, Euro: #{RetrievePacchetto.PDTOCurrent.prezzoEscursione}:" />
				   <p:selectBooleanButton value="#{CreaPP.current.pagatoEscursione}" offLabel="Paga!" onLabel="Pagato" offIcon="ui-icon-check" 
				   onIcon="ui-icon-close"  disabled="#{RetrievePacchetto.pagato.pagatoEscursione}"/>  
           
               <p:commandButton id="pagaButton" value="Effettua pagamento!" oncomplete="PF('confirm').show()" icon="ui-icon-check" title="View">  
               </p:commandButton> 

			</h:panelGrid>
		</p:dialog>
		
		<p:dialog header="Conferma Pagamenti" widgetVar="confirm" resizable="false"
			id="conferma" showEffect="fade" hideEffect="explode" modal="true">
			
			Procedere col pagamento?
			
			 <p:commandButton id="pagaButtonConfSI" value="SI!" icon="ui-icon-check" title="View" action="#{RetrievePacchetto.pagaSI()}"/>  
             <p:commandButton id="pagaButtonConfNO" value="NO!" icon="ui-icon-check" title="View" action="#{CreaPP.pagaNO()}"/>  
		</p:dialog>

	</h:form>
</div>
<h:outputStylesheet library="css" name="css_rules_plain_links.css" />
</h:body>
</html>